#define _CRT_SECURE_NO_WARNINGS 1

#include"linklist.h"

void test()
{
	ListNode* plist = ListInit();
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPushBack(plist, 6);//4 5 6
	ListPrint(plist);

	ListPushFront(plist, 3);
	ListPushFront(plist, 2);
	ListPushFront(plist, 1);//1 2 3 4 5 6
	ListPrint(plist);

	ListPopBack(plist);
	ListPopBack(plist);//1 2 3 4
	ListPrint(plist);

	ListPopFront(plist);
	ListPopFront(plist);//3 4
	ListPrint(plist);

	ListNode* pos1 = ListFind(plist, 4);
	ListInsert(pos1, 0);//3 0 4 
	ListPrint(plist);

	ListNode* pos2 = ListFind(plist, 0);
	ListErase(pos2);//3 4
	ListPrint(plist);

	ListDestory(plist);
}

int main()
{
	test();

	return 0;
}